<template>
  <div>
    <div style="width: 1000px;padding-left: 150px;float: left;">
      <div slot="header" class="clearfix">
        共找到相关结果<font color="red">{{ total }}</font>个<br><br><br>
        <span style="font-size: 30px">相关帖子</span>
      </div>
      <el-card class="box-card">
    <div v-for="(o,index) in listnote" :key="index" class="text item">
      <div style="width: 700px;"><el-button type="info"  circle>{{index+1}}</el-button><span style="font-size: 20px" v-html="o.uName"></span></div>
       <div style="margin-left: 35px;font-size: 18px" v-html="o.dcontent"></div>
        <img :src="o.dimg" style="height: 250px;width: 200px;padding-left: 50px">
     <div style="height:40px;font-size: 20px;float: right">吧主:<span v-html="o.uName"></span><br/>日期:{{o.createtime}}</div>
      <div style="background: aliceblue;height: 4px"></div>
    </div>
      </el-card>
    </div>
    <br><br><br>
    <div style="width: 300px;padding-left:30px;float: left">
      <div slot="header" class="clearfix">
        <span style="font-size: 30px">相关鱼吧</span>
      </div>
        <div v-for="(o,index) in listuser" :key="index" class="text item">
          <el-card style="width: 300px;cursor: pointer">
            <div style="cursor: pointer" @click="fish(o.uId)">
          <img :src="o.uPic" style="border-radius:50%;width: 100px;height: 100px;float: left"/>
            <div style="float: right;width: 100px;margin-right:40px;font-size: 18px" v-html="o.uName"></div>
              <div style="float: right;width: 100px;margin-right:40px;font-size: 18px">贴子数:{{o.num}}</div>
            </div>
          </el-card>
        </div>

    </div>
  </div>
</template>
<style>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both
}

.box-card {
  width: 1000px;
}
</style>

<script>
import axios from "axios";

export default {
  name: "shownote",
  data(){
    return{
      listnote:[],
      word:'',
      total:'',
      listuser:[]
    }
  },
  methods:{
    likenote(){
      axios.post("http://localhost:7000/live-search/search/likeNote",{
        word:this.word,
      }).then(res=>{
        if(res.data.code==200){
          this.listnote=res.data.data;
          this.total=res.data.total;
        }
      })
    },
    likefish(){
      axios.post("http://localhost:7000/live-search/search/likeNote",{
        word:this.word,
        num:1
      }).then(res=>{
        if(res.data.code==200){
          this.listuser=res.data.data;
        }
      })
    },
    fish(id){
      alert(id);
    }
  },
  mounted() {
    this.word=this.$route.params.word;
    this.likenote();
    this.likefish();
  }
}
</script>

<style scoped>

</style>
